package cn.piggy.session;

import cn.piggy.executor.IExecutor;
import cn.piggy.type.AiType;
import okhttp3.Request;
import okhttp3.sse.EventSourceListener;

import java.io.IOException;

public class DefaultSession {
    private final IExecutor iExecutor;

    public DefaultSession(IExecutor iExecutor) {
        this.iExecutor = iExecutor;
    }

    public String syncExecute(Object object) throws IOException, InterruptedException {
        return iExecutor.sync(object);
    }

    public void asyncExecute(Object object, EventSourceListener eventSourceListener) throws IOException, InterruptedException {
        iExecutor.async(object, eventSourceListener);
    }
}
